package com.imooc.controller.superadmin;

import com.imooc.entity.bo.HeadLine;
import com.imooc.entity.dto.Result;
import com.imooc.service.solo.HeadLineService;
import org.simpleframework.core.annotation.Controller;
import org.simpleframework.inject.annotation.AutoWired;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;


@Controller
public class HeadLineOperationController {
    @AutoWired
    private HeadLineService headLineService;

    private Result<Boolean> addHeadLine(HttpServletRequest req, HttpServletResponse resp){
        //TODO：参数校验以及请求参数转化
        return headLineService.addHeadLine(new HeadLine());
    };


    private Result<Boolean> removeHeadLine(HttpServletRequest req, HttpServletResponse resp){
        //TODO：参数校验以及请求参数转化
        return headLineService.removeHeadLine(1);
    };
    private Result<Boolean> modifyHeadLine(HttpServletRequest req, HttpServletResponse resp){
        //TODO：参数校验以及请求参数转化
        return headLineService.modifyHeadLine(new HeadLine());
    };

    private Result<HeadLine> queryHeadLineById(HttpServletRequest req, HttpServletResponse resp){
        //TODO：参数校验以及请求参数转化
        return headLineService.queryHeadLineById(1);
    };

    private Result<List<HeadLine>> queryHeadLine(HttpServletRequest req, HttpServletResponse resp){
        //TODO：参数校验以及请求参数转化
        return headLineService.queryHeadLine(new HeadLine(), 1, 10);
    };


}
